package com.rk.admin.controller;

import com.rk.admin.service.LogsService;
import com.rk.admin.tools.CommonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;



@Api(tags = "日志模块")
@RestController
@RequestMapping("logs")
@CrossOrigin //前后端分离配置跨域访问
public class LogsController  {

    //服务对象
    @Autowired
    private LogsService logsService;

    @ApiOperation("分页查询日志信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "page",value = "分页起始数据",required = true,example = "1"),
            @ApiImplicitParam(name = "limit",value = "每页显示分页最大数据",required = true,example = "10"),
            @ApiImplicitParam(name = "opername",value = "操作人姓名查询",example = "张三"),
    })
    @GetMapping("/findPager")
    public CommonResult findPager(Integer page, Integer limit, String opername){
        System.out.println("前端出的传递过来的参数:当前页码:"+page+"  每页条数:"+limit);
      return CommonResult.success(logsService.selectPage(page,limit,opername));
    }

}

